package cn.dapeng.retry.t02;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

public class TestCase {

    public static void main(String[] args) {
        RetryService retryService = new RetryServiceImpl();
        InvocationHandler invocationHandler = new RetryInvocationHandler<>(retryService);

        RetryService proxy = (RetryService) Proxy.newProxyInstance(retryService.getClass().getClassLoader(), retryService.getClass().getInterfaces(), invocationHandler);
        proxy.service();
    }

}
